<html>
<head><meta charset="utf-8"><title>generator upvars · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html">generator upvars</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209027982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209027982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209027982">(Sep 03 2020 at 20:52)</a>:</h4>
<p>about <a href="https://github.com/rust-lang/rust/issues/75992">https://github.com/rust-lang/rust/issues/75992</a> and its friends</p>
<p>After <a href="https://github.com/rust-lang/rust/issues/75443">#75443</a> we now normalize <code>for&lt;'a&gt; impl Trait&lt;'a&gt;</code>. This change now allows us to normalize generator upvars<br>
which reference other generators/futures resulting in huge types.</p>
<p>I personally don't know enough about how to fix this, so I need some help here.</p>



<a name="209028365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028365">(Sep 03 2020 at 20:55)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span> considering that <a href="https://github.com/rust-lang/rust/issues/75443">#75443</a> isn't too necessary, it might be easier to just revert that PR and instead use the pr by <span class="user-mention" data-user-id="120791">@RalfJ</span></p>



<a name="209028491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028491">(Sep 03 2020 at 20:56)</a>:</h4>
<p>oh, that's annoying</p>



<a name="209028541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028541">(Sep 03 2020 at 20:56)</a>:</h4>
<p>did the PR not have any impact on perf.r-l.o?</p>



<a name="209028545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028545">(Sep 03 2020 at 20:56)</a>:</h4>
<p>we should just remove <code>type_length_limit</code></p>



<a name="209028558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028558">(Sep 03 2020 at 20:57)</a>:</h4>
<p>IIRC isn't all of the hanging just from the code checking <code>type_length_limit</code>?</p>



<a name="209028571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028571">(Sep 03 2020 at 20:57)</a>:</h4>
<p>which, ironically, is trying to prevent other parts of the compiler from doing excessive work</p>



<a name="209028587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028587">(Sep 03 2020 at 20:57)</a>:</h4>
<p>I don't know, I can try disabling it and see if the hang is fixed by that</p>



<a name="209028609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028609">(Sep 03 2020 at 20:57)</a>:</h4>
<p>I recall there was another issue some of this was discussed on</p>



<a name="209028672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028672">(Sep 03 2020 at 20:58)</a>:</h4>
<p>also <a href="https://www.reddit.com/r/rust/comments/iingya/compiler_regression_on_1460/g38281x/">https://www.reddit.com/r/rust/comments/iingya/compiler_regression_on_1460/g38281x/</a></p>



<a name="209028724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028724">(Sep 03 2020 at 20:59)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/54540#issuecomment-485240110">https://github.com/rust-lang/rust/issues/54540#issuecomment-485240110</a></p>



<a name="209028743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028743">(Sep 03 2020 at 20:59)</a>:</h4>
<p>so this was a known problem for more than a year</p>



<a name="209028845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028845">(Sep 03 2020 at 21:00)</a>:</h4>
<p>do we really not need that limit anymore?</p>



<a name="209028881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209028881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209028881">(Sep 03 2020 at 21:00)</a>:</h4>
<p>btw this assumption is incorrect, the blow-up is observable by default, the value is only compared with the attribute (or the default) only <em>after</em> computing it (and computing it has the exponential blow-up) <a href="https://github.com/rust-lang/rust/issues/54540#issuecomment-488630418">https://github.com/rust-lang/rust/issues/54540#issuecomment-488630418</a></p>



<a name="209029061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029061">(Sep 03 2020 at 21:01)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I can't think why we would. if we do for something,  it's a workaround to properly handling that situation efficiently</p>



<a name="209029155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029155">(Sep 03 2020 at 21:02)</a>:</h4>
<p>we should dig up why it was added, IMO it's a mistake to assume we need it (or <em>ever</em> needed it)</p>



<a name="209029179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029179">(Sep 03 2020 at 21:02)</a>:</h4>
<p>as in, it likely was always an imperfect workaround</p>



<a name="209029215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029215">(Sep 03 2020 at 21:02)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/37789">https://github.com/rust-lang/rust/pull/37789</a></p>



<a name="209029373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029373">(Sep 03 2020 at 21:04)</a>:</h4>
<p>huh <a href="https://github.com/rust-lang/rust/issues/37311">https://github.com/rust-lang/rust/issues/37311</a></p>



<a name="209029395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029395">(Sep 03 2020 at 21:04)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> at least we have examples to try with the limit removed</p>



<a name="209029411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029411">(Sep 03 2020 at 21:04)</a>:</h4>
<blockquote>
<p>All of these examples create an exponentially-long type, and if we do anything to it before the recursion limit is reached, we hang (in fact, my "reduced" example hangs while printing the overflow error message).</p>
</blockquote>



<a name="209029414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029414">(Sep 03 2020 at 21:04)</a>:</h4>
<p>haha</p>



<a name="209029457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029457">(Sep 03 2020 at 21:05)</a>:</h4>
<p>so it's not even something like LLVM type names, just an UX workaround</p>



<a name="209029651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029651">(Sep 03 2020 at 21:07)</a>:</h4>
<p>if it's during printing a message, we could have a message printed just before the one which includes the details that can take forever to print</p>



<a name="209029777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029777">(Sep 03 2020 at 21:08)</a>:</h4>
<p>and/or a custom <code>fmt::Write</code> implementation that after a certain length, errors through panicking (i.e. fatal error)</p>



<a name="209029811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029811">(Sep 03 2020 at 21:08)</a>:</h4>
<p>it doesn't look like <code>type_length_limit</code> is the cause here</p>



<a name="209029835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029835">(Sep 03 2020 at 21:08)</a>:</h4>
<p>with:</p>
<div class="codehilite"><pre><span></span><code>lcnr@lcnr-pc:~/wtf$ time cargo +stage1 build
   Compiling dummy v0.1.0 (/home/lcnr/wtf/dummy)
   Compiling wtf v0.1.0 (/home/lcnr/wtf)
    Finished dev [unoptimized + debuginfo] target(s) in 17.46s

real    0m17,475s
user    0m17,384s
sys     0m0,136s
</code></pre></div>



<a name="209029838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029838">(Sep 03 2020 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> what's the patch you tested with?</p>



<a name="209029851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029851">(Sep 03 2020 at 21:09)</a>:</h4>
<p>without</p>
<div class="codehilite"><pre><span></span><code>lcnr@lcnr-pc:~/wtf$ time cargo +stage1x build
   Compiling dummy v0.1.0 (/home/lcnr/wtf/dummy)
   Compiling wtf v0.1.0 (/home/lcnr/wtf)
    Finished dev [unoptimized + debuginfo] target(s) in 18.06s

real    0m18,070s
user    0m17,966s
sys     0m0,133s
</code></pre></div>



<a name="209029903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209029903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209029903">(Sep 03 2020 at 21:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>From 7278b15f0d72a39cbebed2c702bdc4e587f7f167 Mon Sep 17 00:00:00 2001
From: Bastian Kauschke &lt;bastian_kauschke@hotmail.de&gt;
Date: Thu, 3 Sep 2020 23:09:32 +0200
Subject: [PATCH] patch

---
 .../rustc_mir/src/monomorphize/collector.rs   | 52 +------------------
 1 file changed, 1 insertion(+), 51 deletions(-)

diff --git a/compiler/rustc_mir/src/monomorphize/collector.rs b/compiler/rustc_mir/src/monomorphize/collector.rs
index 43cac8e5ee6..8c2a12c4141 100644
--- a/compiler/rustc_mir/src/monomorphize/collector.rs
+++ b/compiler/rustc_mir/src/monomorphize/collector.rs
@@ -191,12 +191,11 @@ use rustc_middle::mir::mono::{InstantiationMode, MonoItem};
 use rustc_middle::mir::visit::Visitor as MirVisitor;
 use rustc_middle::mir::{self, Local, Location};
 use rustc_middle::ty::adjustment::{CustomCoerceUnsized, PointerCast};
-use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts};
+use rustc_middle::ty::subst::InternalSubsts;
 use rustc_middle::ty::{self, GenericParamDefKind, Instance, Ty, TyCtxt, TypeFoldable};
 use rustc_session::config::EntryFnType;
 use rustc_span::source_map::{dummy_spanned, respan, Span, Spanned, DUMMY_SP};
 use smallvec::SmallVec;
-use std::iter;

 #[derive(PartialEq)]
 pub enum MonoItemCollectionMode {
@@ -375,7 +374,6 @@ fn collect_items_rec&lt;&#39;tcx&gt;(
             // Keep track of the monomorphization recursion depth
             recursion_depth_reset =
                 Some(check_recursion_limit(tcx, instance, starting_point.span, recursion_depths));
-            check_type_length_limit(tcx, instance);

             rustc_data_structures::stack::ensure_sufficient_stack(|| {
                 collect_neighbours(tcx, instance, &amp;mut neighbors);
@@ -455,55 +453,7 @@ fn check_recursion_limit&lt;&#39;tcx&gt;(
     (def_id, recursion_depth)
 }

-fn check_type_length_limit&lt;&#39;tcx&gt;(tcx: TyCtxt&lt;&#39;tcx&gt;, instance: Instance&lt;&#39;tcx&gt;) {
-    let type_length = instance
-        .substs
-        .iter()
-        .flat_map(|arg| arg.walk())
-        .filter(|arg| match arg.unpack() {
-            GenericArgKind::Type(_) | GenericArgKind::Const(_) =&gt; true,
-            GenericArgKind::Lifetime(_) =&gt; false,
-        })
-        .count();
-    debug!(&quot; =&gt; type length={}&quot;, type_length);
-
-    // Rust code can easily create exponentially-long types using only a
-    // polynomial recursion depth. Even with the default recursion
-    // depth, you can easily get cases that take &gt;2^60 steps to run,
-    // which means that rustc basically hangs.
-    //
-    // Bail out in these cases to avoid that bad user experience.
-    if !tcx.sess.type_length_limit().value_within_limit(type_length) {
-        // The instance name is already known to be too long for rustc.
-        // Show only the first and last 32 characters to avoid blasting
-        // the user&#39;s terminal with thousands of lines of type-name.
-        let shrink = |s: String, before: usize, after: usize| {
-            // An iterator of all byte positions including the end of the string.
-            let positions = || s.char_indices().map(|(i, _)| i).chain(iter::once(s.len()));
-
-            let shrunk = format!(
-                &quot;{before}...{after}&quot;,
-                before = &amp;s[..positions().nth(before).unwrap_or(s.len())],
-                after = &amp;s[positions().rev().nth(after).unwrap_or(0)..],
-            );

-            // Only use the shrunk version if it&#39;s really shorter.
-            // This also avoids the case where before and after slices overlap.
-            if shrunk.len() &lt; s.len() { shrunk } else { s }
-        };
-        let msg = format!(
-            &quot;reached the type-length limit while instantiating `{}`&quot;,
-            shrink(instance.to_string(), 32, 32)
-        );
-        let mut diag = tcx.sess.struct_span_fatal(tcx.def_span(instance.def_id()), &amp;msg);
-        diag.note(&amp;format!(
-            &quot;consider adding a `#![type_length_limit=\&quot;{}\&quot;]` attribute to your crate&quot;,
-            type_length
-        ));
-        diag.emit();
-        tcx.sess.abort_if_errors();
-    }
-}

 struct MirNeighborCollector&lt;&#39;a, &#39;tcx&gt; {
     tcx: TyCtxt&lt;&#39;tcx&gt;,
--
2.25.1
</code></pre></div>



<a name="209030129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030129">(Sep 03 2020 at 21:12)</a>:</h4>
<p>can you use "\`\`\`patch" or "\`\`\`diff" to make it show right?</p>



<a name="209030136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030136">(Sep 03 2020 at 21:12)</a>:</h4>
<p>my <code>stage1</code> build has some added debug message, let me try without that one (edit: didn't matter)</p>



<a name="209030213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030213">(Sep 03 2020 at 21:13)</a>:</h4>
<p>wow, good job Zulip, not letting me escape backticks</p>



<a name="209030332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030332">(Sep 03 2020 at 21:13)</a>:</h4>
<p>okay that change seems excessive enough to do the trick, that's worrying</p>



<a name="209030458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030458">(Sep 03 2020 at 21:14)</a>:</h4>
<p>also the <code>impl Trait</code> thing... shouldn't matter? like, it already compiles just fine, only MIR had issues with it?<br>
if it couldn't normalize at all, wouldn't <code>layout_of</code> break?</p>



<a name="209030488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030488">(Sep 03 2020 at 21:15)</a>:</h4>
<p>my PR only fixed a mir assertion</p>



<a name="209030515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030515">(Sep 03 2020 at 21:15)</a>:</h4>
<p>Not sure when the generator upvars were previously normalized</p>



<a name="209030525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030525">(Sep 03 2020 at 21:15)</a>:</h4>
<p>potentially never</p>



<a name="209030552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030552">(Sep 03 2020 at 21:15)</a>:</h4>
<p>you need them for the layout</p>



<a name="209030633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030633">(Sep 03 2020 at 21:16)</a>:</h4>
<p>hmm <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/layout.rs#L1253-L1260">https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/layout.rs#L1253-L1260</a></p>



<a name="209030678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030678">(Sep 03 2020 at 21:16)</a>:</h4>
<p>oh wait, the <code>ty::Opaque</code> doesn't contain the bounds. so it's not <code>impl for&lt;'a&gt; Trait&lt;'a&gt;</code> <em>at all</em></p>



<a name="209030707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030707">(Sep 03 2020 at 21:17)</a>:</h4>
<p>no, it's <code>for&lt;'a&gt; impl Trait&lt;'a&gt;</code></p>



<a name="209030720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030720">(Sep 03 2020 at 21:17)</a>:</h4>
<p>well, not <em>literally</em> that</p>



<a name="209030732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030732">(Sep 03 2020 at 21:17)</a>:</h4>
<p>ye <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="209030747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030747">(Sep 03 2020 at 21:17)</a>:</h4>
<p>it's <code>for&lt;'a&gt; .... impl Trait&lt;'a&gt;</code>. okay</p>



<a name="209030781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030781">(Sep 03 2020 at 21:17)</a>:</h4>
<p>so <code>normalize_erasing_regions</code> should've worked anyway. I don't understand why the MIR assertion failed given that</p>



<a name="209030871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209030871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209030871">(Sep 03 2020 at 21:18)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> what does <code>-Z self-profile</code> + <code>summarize</code> says? like, where's the 17 seconds actually spent?</p>



<a name="209031410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/209031410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#209031410">(Sep 03 2020 at 21:24)</a>:</h4>
<div class="codehilite"><pre><span></span><code>+-------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                            | Self time | % of total time | Time     | Item count |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| normalize_generic_arg_after_erasing_regions     | 8.84s     | 52.185          | 8.85s    | 340        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| type_op_prove_predicate                         | 2.70s     | 15.909          | 2.70s    | 369        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| implied_outlives_bounds                         | 1.17s     | 6.927           | 1.17s    | 82         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| typeck                                          | 971.00ms  | 5.731           | 1.45s    | 58         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| monomorphization_collector_graph_walk           | 968.64ms  | 5.717           | 6.84s    | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| mir_borrowck                                    | 827.65ms  | 4.885           | 11.87s   | 58         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| check_mod_privacy                               | 541.76ms  | 3.198           | 541.79ms | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| evaluate_obligation                             | 184.43ms  | 1.089           | 185.40ms | 582        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| lint_mod                                        | 152.97ms  | 0.903           | 153.00ms | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| run_linker                                      | 100.17ms  | 0.591           | 100.17ms | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| type_op_normalize_predicate                     | 94.09ms   | 0.555           | 113.69ms | 245        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| type_op_normalize_fn_sig                        | 75.54ms   | 0.446           | 75.54ms  | 127        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| type_op_normalize_ty                            | 56.59ms   | 0.334           | 56.59ms  | 162        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| privacy_access_levels                           | 46.79ms   | 0.276           | 46.79ms  | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                    | 43.02ms   | 0.254           | 43.02ms  | 17         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| dropck_outlives                                 | 28.70ms   | 0.169           | 30.44ms  | 135        |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| check_mod_item_types                            | 27.02ms   | 0.159           | 6.22s    | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| normalize_projection_ty                         | 19.68ms   | 0.116           | 19.70ms  | 40         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                     | 13.59ms   | 0.080           | 13.59ms  | 1          |
+-------------------------------------------------+-----------+-----------------+----------+------------+
| optimized_mir                                   | 6.49ms    | 0.038           | 7.32s    | 91         |
+-------------------------------------------------+-----------+-----------------+----------+------------+
</code></pre></div>



<a name="210613603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210613603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210613603">(Sep 19 2020 at 12:51)</a>:</h4>
<p>looking a bit more into this, there are some nearly 1 second delays here which seem wierd to me</p>
<div class="codehilite"><pre><span></span><code>Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth(depth=0, value=[])
Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 result=[] with 0 obligations
Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 obligations=[]
Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth(depth=0, value=[])
Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 result=[] with 0 obligations
Sep 19 14:49:41.316 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 obligations=[]
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth(depth=0, value=[])
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 result=[] with 0 obligations
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 obligations=[]
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth(depth=0, value=[TraitPredicate(&lt;() as std::marker::Sized&gt;), OutlivesPredicate((), ReStatic), TraitPredicate(&lt;() as std::process::Termination&gt;)])
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 result=[TraitPredicate(&lt;() as std::marker::Sized&gt;), OutlivesPredicate((), ReStatic), TraitPredicate(&lt;() as std::process::Termination&gt;)] with 0 obligations
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=0 obligations=[]
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth(depth=1, value=&lt;() as std::process::Termination&gt;)
Sep 19 14:49:42.269 DEBUG rustc_trait_selection::traits::project: normalize_with_depth: depth=1 result=&lt;() as std::process::Termination&gt; with 0 obligations
</code></pre></div>



<a name="210616416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210616416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210616416">(Sep 19 2020 at 13:55)</a>:</h4>
<p>Maybe the issues are enormous <code>Equate</code>s <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> to find out if a candidate applies while normalizing <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="210616462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210616462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210616462">(Sep 19 2020 at 13:56)</a>:</h4>
<p>though I am not really sure how to optimize that</p>



<a name="210617662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210617662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210617662">(Sep 19 2020 at 14:24)</a>:</h4>
<p>I've spend hours looking at the wrong file</p>



<a name="210617672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210617672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210617672">(Sep 19 2020 at 14:24)</a>:</h4>
<p>that's life</p>



<a name="210617679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210617679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210617679">(Sep 19 2020 at 14:24)</a>:</h4>
<p>but maybe I finally make some progress now <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="210617717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210617717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210617717">(Sep 19 2020 at 14:26)</a>:</h4>
<p>I feel your pain, I spent like a week on <a href="https://github.com/rust-lang/rust/pull/75176">https://github.com/rust-lang/rust/pull/75176</a> looking at the completely wrong problem lol</p>



<a name="210620984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/210620984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#210620984">(Sep 19 2020 at 15:38)</a>:</h4>
<p>opened <a href="https://github.com/rust-lang/rust/issues/76928">#76928</a>, the change is far too boring for me to have spend so much time on it <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="214617274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214617274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214617274">(Oct 26 2020 at 18:49)</a>:</h4>
<p>now that <a href="https://github.com/rust-lang/rust/issues/76928">#76928</a> landed fixing <a href="https://github.com/rust-lang/rust/issues/75992">#75992</a> looks a lot more annoying than before</p>



<a name="214617440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214617440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214617440">(Oct 26 2020 at 18:50)</a>:</h4>
<p><code>summarize</code> output for <a href="https://github.com/nicholasbishop/rust146hang">https://github.com/nicholasbishop/rust146hang</a> :</p>
<div class="codehilite"><pre><span></span><code>+--------------------------------------------------+-----------+-----------------+----------+------------+
| Item                                             | Self time | % of total time | Time     | Item count |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_fulfill_obligation                       | 88.99s    | 30.321          | 99.55s   | 935        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| normalize_generic_arg_after_erasing_regions      | 81.03s    | 27.610          | 151.97s  | 2854       |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| normalize_projection_ty                          | 70.88s    | 24.153          | 70.89s   | 346        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_passes                                      | 37.75s    | 12.864          | 37.75s   | 1          |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| evaluate_obligation                              | 10.54s    | 3.591           | 10.61s   | 2902       |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen_emit_obj                     | 1.80s     | 0.614           | 1.80s    | 179        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| codegen_module                                   | 1.12s     | 0.382           | 37.80s   | 179        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| LLVM_module_codegen                              | 176.13ms  | 0.060           | 1.98s    | 179        |
+--------------------------------------------------+-----------+-----------------+----------+------------+
| specialization_graph_of                          | 110.39ms  | 0.038           | 200.13ms | 85         |
</code></pre></div>



<a name="214617716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214617716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214617716">(Oct 26 2020 at 18:53)</a>:</h4>
<p>with version 1.45 this takes 32s total</p>



<a name="214617987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214617987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214617987">(Oct 26 2020 at 18:55)</a>:</h4>
<p>so all of  codegen_fulfill_obligation, normalize_generic_arg_after_erasing_regions, normalize_projection_ty  and LLVM_passes are now taking longer than 1.45 took in total and would need to get fixed. Esp for <code>codegen_fulfill_obligations</code> I am not even sure how we can fix this</p>



<a name="214618778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214618778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214618778">(Oct 26 2020 at 19:01)</a>:</h4>
<p>i am inclined to revert <a href="https://github.com/rust-lang/rust/issues/75443">#75443</a> and instead merge <a href="https://github.com/rust-lang/rust/issues/75419">#75419</a>, potentially disabling the mir validator for a backport</p>



<a name="214618792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214618792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214618792">(Oct 26 2020 at 19:01)</a>:</h4>
<p>will quickly open a PR for that</p>



<a name="214625660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214625660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214625660">(Oct 26 2020 at 20:02)</a>:</h4>
<p>opened <a href="https://github.com/rust-lang/rust/issues/78410">#78410</a> :/ i think this is the first time opening a pr was unpleasant to me.</p>



<a name="214649000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214649000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214649000">(Oct 27 2020 at 00:22)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> you're doing god's work <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="214649045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/generator%20upvars/near/214649045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/generator.20upvars.html#214649045">(Oct 27 2020 at 00:23)</a>:</h4>
<p>if it makes you feel better, I've made much larger hacks <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> <a href="https://github.com/rust-lang/rust/pull/75127">https://github.com/rust-lang/rust/pull/75127</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>